﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GamedataLibrary
{
    /// <summary>
    /// Trida reprezentujici instanci bojovnika.
    /// Uklada stav hrace.
    /// </summary>
    class Fighter
    {
        #region Fields
        
        CharactersID id;
        Characters.Character character;
        int health;
        int stunned;
        int defense;
        int jutsu1Cooldown;
        int jutsu2Cooldown;
        int jutsu3Cooldown;
        int jutsu4Cooldown;
        string log;
        bool recentlyStunned;

        #endregion // Fields

        #region Properties

        /// <summary>
        /// Vrati ID zvolene postavy.
        /// </summary>
        public CharactersID ID { get { return id; } }

        /// <summary>
        /// Hracem zvolena postava.
        /// </summary>
        public Characters.Character Character { get { return character; } set { character = value; } }

        /// <summary>
        /// Zdravi hrace.
        /// </summary>
        public int Health { get { return health; } set { health = value; } }

        /// <summary>
        /// Getter a setter na stav stunned (na jak dlouho je postava omracena).
        /// </summary>
        public int Stunned { get { return stunned; } set { stunned = value; } }

        /// <summary>
        /// Getter a setter na hodnotu defense postavy.
        /// </summary>
        public int Defense { get { return defense; } set { defense = value; } }

        public int Jutsu1Cooldown { get { return jutsu1Cooldown; } set { jutsu1Cooldown = value; } }

        public int Jutsu2Cooldown { get { return jutsu2Cooldown; } set { jutsu2Cooldown = value; } }
        
        public int Jutsu3Cooldown { get { return jutsu3Cooldown; } set { jutsu3Cooldown = value; } }
        
        public int Jutsu4Cooldown { get { return jutsu4Cooldown; } set { jutsu4Cooldown = value; } }

        public string Log { get { return log; } set { log = value; } }

        public bool RecentlyStunned { get { return recentlyStunned; } set { recentlyStunned = value; } }

        #endregion // Properties

        /// <summary>
        /// Vytvori instanci Fightera.
        /// </summary>
        /// <param name="c">Zvolena postava.</param>
        public Fighter(CharactersID id, Characters.Character c)
        {
            this.id = id;
            this.character = c;
            this.health = 1000;
            this.stunned = 0;
            this.defense = 0;
            this.jutsu1Cooldown = 0;
            this.jutsu2Cooldown = 0;
            this.jutsu3Cooldown = 0;
            this.jutsu4Cooldown = 0;
            this.recentlyStunned = false;
        }

        /// <summary>
        /// Zjisti, jestli je bojovnik zivy.
        /// </summary>
        /// <returns>Vrati TRUE, pokdu je bojovnik zivy.</returns>
        public bool IsAlive()
        {
            if (health > 0) return true;
            else return false;
        }
    }
}
